org.eclipse.vtp.desktop.projects.core.internals
Class DatabaseSet

java.lang.Object
  extended by org.eclipse.vtp.desktop.projects.core.internals.VoiceResource
      extended by org.eclipse.vtp.desktop.projects.core.internals.DatabaseSet
All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable, IDatabaseSet, ObjectListener, IVoiceToolsResource

public class DatabaseSet
extends VoiceResource
implements IDatabaseSet

This is a concrete implementation of IDatabaseSet and provides the default behavior of that interface.

Version:
2.0
Author:
Trip Gilman

Constructor Summary
DatabaseSet(VoiceToolsDesignProject project, org.eclipse.core.resources.IFolder folder)
          Creates a new DatabaseSet with the given application project and eclipse folder resource.
 
Method Summary
 IDatabase createDatabase(java.lang.String name)
          Creates a new database folder resource with the given name.
 void deleteDatabase(IDatabase database)
          Removes the given database from this application.
 java.util.List getDatabases()
           
 java.lang.String getName()
           
protected  java.lang.String getObjectId()
          The object id is used by the event system to uniquely identify a project resource.
 IVoiceToolsResource getParent()
          Returns the parent of this resource.
 
Methods inherited from class org.eclipse.vtp.desktop.projects.core.internals.VoiceResource
addRefreshListener, deferEvents, finalize, getAdapter, getProject, processObjectEvent, refresh, removeRefreshListener, resumeEvents
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.vtp.desktop.projects.core.IVoiceToolsResource
addRefreshListener, deferEvents, getProject, refresh, removeRefreshListener, resumeEvents
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Constructor Detail

DatabaseSet

public DatabaseSet(VoiceToolsDesignProject project,
                   org.eclipse.core.resources.IFolder folder)
Creates a new DatabaseSet with the given application project and eclipse folder resource.

Parameters:
project - The parent application project
folder - The eclipse folder resource this database set represents
Method Detail

getName

public java.lang.String getName()
Specified by:
getName in interface IVoiceToolsResource
Returns:
The name of the resource

getObjectId

protected java.lang.String getObjectId()
Description copied from class: VoiceResource
The object id is used by the event system to uniquely identify a project resource. In this fashion, multiple references to the resource can be created and still be notified of events.

Specified by:
getObjectId in class VoiceResource
Returns:
A unique identifier for this resource

getParent

public IVoiceToolsResource getParent()
Description copied from interface: IVoiceToolsResource
Returns the parent of this resource. If this is a project resource this function returns this.

Specified by:
getParent in interface IVoiceToolsResource
Returns:
The parent of this resource resource

getDatabases

public java.util.List getDatabases()
Specified by:
getDatabases in interface IDatabaseSet
Returns:
The list of IDatabases that are defined in this application project

createDatabase

public IDatabase createDatabase(java.lang.String name)
                         throws org.eclipse.core.runtime.CoreException
Description copied from interface: IDatabaseSet
Creates a new database folder resource with the given name. The database will not initially contain any database table definitions.

Specified by:
createDatabase in interface IDatabaseSet
Parameters:
name - The name of the database folder resource
Returns:
The newly created database folder resource
Throws:
org.eclipse.core.runtime.CoreException - If an error occured during the creation of the required file or folder resources of the database definition

deleteDatabase

public void deleteDatabase(IDatabase database)
Description copied from interface: IDatabaseSet
Removes the given database from this application. This will also remove all database table definitions contained by the database folder resource.

Specified by:
deleteDatabase in interface IDatabaseSet
Parameters:
database - The database definition to remove